//part1:C03:ex3.24.cpp -- vector with 10 elements.
#include <iostream>
#include <iterator>
#include <vector>

int main(void)
{
    using namespace std;
    vector<int> vInt;
    int iVal;
    cout << "Enter some integers:\n";
    while (cin >> iVal)
    {
        vInt.push_back(iVal);
    }
    if (vInt.cbegin() == vInt.cend())
    {
        cout << "No elements!" << endl;
        return -1;
    }
    cout <<"sum of ajaent is :\n";
    for (auto it = vInt.cbegin(); it != vInt.cend() - 1; it++)
    {
        cout << (*it + *(++it)) << " ";
        if ((it - vInt.cbegin() + 1) % 10 == 0)
        {
            cout << endl;
        }
    }
    if (vInt.size() % 2 != 0)
    {
        cout << *(vInt.cend() - 1);
    }
    
    return 0;
}